package com.situ.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.situ.mvc.common.ServerResponse;
import com.situ.mvc.service.IUserService;
import com.situ.mvc.service.impl.UserServiceImpl;

@Controller
@RequestMapping(value = "/user")
public class UserController {
	
	private IUserService userService = new UserServiceImpl();
	
	@RequestMapping(value = "/getLoginPage")
	public String getLoginPage(){
		return "login";
	}
	
	@RequestMapping(value = "/login")
	@ResponseBody
	public ServerResponse login(String name,String password){
		ServerResponse response = userService.login(name,password);
		return response;
	}

}
